/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.wordpress.fareastdan.FEDTradeManagerIDE.FEDConnectionManager;

import java.util.Arrays;
import java.util.List;
import org.openide.nodes.AbstractNode;
import org.openide.nodes.ChildFactory;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.util.lookup.Lookups;

/**
 *
 * @author user
 */
public class FEDServerChildFactory extends ChildFactory<FEDServer>
{
    public FEDServerChildFactory()
            
    {
    }

    @Override
    protected boolean createKeys(List<FEDServer> list)
    {
        FEDServer[] servers = new FEDServer[0];
        list.addAll(Arrays.asList(servers));
        
        return true; 
    }
    
    @Override
    protected Node createNodeForKey(FEDServer key) 
    {
        Node result = new AbstractNode
                                     (
                                     Children.create
                                                   (
                                                   new FEDServerChildFactory(), 
                                                   true
                                                   ), 
                                     Lookups.singleton(key)
                                     );
        result.setDisplayName(key.toString());
        return result;
    }    
}
